#include <iostream>
#include <vector>
#include <string>

using namespace std;

int strTointTime(string timeStr){
    int minutes = (timeStr[4]-'0')+(timeStr[3]-'0')*10;
    int hours = (timeStr[1]-'0')+(timeStr[0]-'0')*10;
    return minutes + hours*60;
}

void quickSort(vector<int>& times, int low, int high){
    if(low >= high) return;
    int pivot = times[low];
    int leftIdx = low, rightIdx = high;
    while(leftIdx < rightIdx){
        while(leftIdx < rightIdx && times[rightIdx] >= pivot)
            --rightIdx;
        times[leftIdx] = times[rightIdx];
        while(leftIdx < rightIdx && times[leftIdx] < pivot)
            ++leftIdx;
        times[rightIdx] = times[leftIdx];
    }
    times[leftIdx] = pivot;
    quickSort(times, low, leftIdx-1);
    quickSort(times, leftIdx+1, high);
}

int main(){
    int arr[] = {45,23,64,87,123,53,23,55,1,2,454,2,3,556,98};
    int length = sizeof(arr)/sizeof(int);
    vector<int> nums(arr, arr+length);
    quickSort(nums, 0, length-1);
    for(vector<int>::const_iterator iter = nums.begin(); iter != nums.end(); ++iter)
        std::cout << *iter << " ";
    std::cout << std::endl;
    return 0;
}